<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>

<body>
    <div id="app">
        <my-one>
            <template v-slot:head>
                <div>头部</div>
            </template>
            <template #middle>
                <div>中间</div>
            </template>
            <template v-slot:default>
                <div>尾部</div>
            </template>
        </my-one>
    </div>

    <script>
        Vue.component("my-one", {

            template: `
            <div>
                <slot name="head"></slot>
                <p>我是子组件</p>
                <slot name="middle"></slot>                    
                <p>我是子组件</p>
                <slot></slot>
            </div>
            `,
        });

        var app = new Vue({
            el: "#app",
        });
    </script>
</body>

</html>